from flask import  g,render_template

'''
统一渲染方法
'''
def osp_render (template, context={}):
    if 'current_user' in g:
        context['current_user'] = g.current_user
    return render_template(template, **context)

'''
统一获取当前时间
'''
import  datetime
def getCurrentDate (format = "%Y-%m-%d %H:%M:%S"):
    return  datetime.datetime.now().strftime(format)